cmake_minimum_required(VERSION 3.4.1)
project(main)
#set(CMAKE_CXX_COMPILER ${ANDROID_NDK}/toolchains/llvm/prebuilt/windows/bin/)
set(distribution_DIR ${CMAKE_SOURCE_DIR}/soLib/${ANDROID_ABI})
include_directories(${distribution_DIR}/include)
add_library(
        avcodec
        SHARED
        IMPORTED
)
set_target_properties(
        avcodec
        PROPERTIES IMPORTED_LOCATION
        ${distribution_DIR}/lib/libavcodec.so
)
add_library(
        avdevice
        SHARED
        IMPORTED
)
set_target_properties(
        avdevice
        PROPERTIES IMPORTED_LOCATION
        ${distribution_DIR}/lib/libavdevice.so
)
add_library(
        avfilter
        SHARED
        IMPORTED
)
set_target_properties(
        avfilter
        PROPERTIES IMPORTED_LOCATION
        ${distribution_DIR}/lib/libavfilter.so
)
add_library(
        avformat
        SHARED
        IMPORTED
)
set_target_properties(
        avformat
        PROPERTIES IMPORTED_LOCATION
        ${distribution_DIR}/lib/libavformat.so
)
add_library(
        avutil
        SHARED
        IMPORTED
)
set_target_properties(
        avutil
        PROPERTIES IMPORTED_LOCATION
        ${distribution_DIR}/lib/libavutil.so
)
add_library(
        swresample
        SHARED
        IMPORTED
)
set_target_properties(
        swresample
        PROPERTIES IMPORTED_LOCATION
        ${distribution_DIR}/lib/libswresample.so
)
add_library(
        swscale
        SHARED
        IMPORTED
)
set_target_properties(
        swscale
        PROPERTIES IMPORTED_LOCATION
        ${distribution_DIR}/lib/libswscale.so
)
add_library(
        ssl
        SHARED
        IMPORTED
)
set_target_properties(
        ssl
        PROPERTIES IMPORTED_LOCATION
        ${distribution_DIR}/lib/libssl.so
)
add_library(
        crypto
        SHARED
        IMPORTED
)
set_target_properties(
        crypto
        PROPERTIES IMPORTED_LOCATION
        ${distribution_DIR}/lib/libcrypto.so
)
add_library(
        main
        SHARED
        src/main/cpp/main.cpp
        src/main/cpp/player.cpp
)
find_library(
        log-lib
        log
)
target_link_libraries(
        main
        swresample
        swscale
        avcodec
        avfilter
        avdevice
        avformat
        avutil
        crypto
        ssl
        OpenSLES
        GLESv3
        ${log-lib}
)